package com.swing.games.snake;

import com.swing.games.snake.pages.Index;

import javax.swing.*;

/**
 * 展示支架：JFrame（热加载……饥饿模式）
 *
 * @author Yuang, Gongming
 * @date 2022-02-10 10:46
 */
public class SnakeFrame extends JFrame {

    private static SnakeFrame snakeFrame = new SnakeFrame();

    private SnakeFrame() {
//        this.setUndecorated(true);
        this.add(new Index());
        this.setTitle("Snake");
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        this.setResizable(false);
        this.pack();
        this.setVisible(true);
        this.setLocationRelativeTo(null);
    }

    public static SnakeFrame getInstance() {
        return snakeFrame;
    }

}
